<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="themes/default/layout/public">

<head>
    <link th:href="@{/static/js/summernote/summernote.css}" rel="stylesheet"/>
</head>
<div  layout:fragment="content">
    <div class="row">
        <div class="col-xs-12 col-md-9 main">
            <h2 class="h4  mt-30">
                我的兑换
            </h2>
            <div class="widget-streams">
                <section th:each="ex:${exchanges}" class="stream-list-item ">
                    <span class="text-gold"><i class="fa fa-database"></i><th:block th:text="${ex.coin}"/></span>
                    <a href="{{ route('shop.goods.detail',['id'=>$exchange->goods_id]) }}" target="_blank" th:text="${ex.good.name}"></a>
                    <span th:if="${ex.status==1}" class="label label-warning ml-10">已处理</span>
                    <span th:if="${ex.status==0}" class="label label-success ml-10">未处理</span>
                    <span th:if="${ex.status==2}" class="label label-default ml-10">兑换失败</span>
                    <span class="text-muted ml-10" th:text="${#dates.format(ex.createdAt,GlobalSetting.time.dateFormat+' '+GlobalSetting.time.timeFormat)}"></span>

                </section>
            </div>

            <div class="text-center">
                <ul class="pagination">
                    <li th:onclick="'javascript:goToPage(1)'" class="page-item" th:classappend="${exchanges.number+1 == 1}?disabled:''">
                        <a class="page-link" th:href="|?page=1&size=${exchanges.size}|" rel="prev">‹</a>
                    </li>
                    <li th:each="i:${#numbers.sequence(exchanges.number+1-6,exchanges.number+6)}" class="page-item" th:classappend="${exchanges.number+1 == i}?'active':''" th:if="${i>0 and i<=exchanges.totalPages}">
                        <a class="page-link" th:href="|?page=${i}&size=${exchanges.size}|" th:text="${i}"></a>
                    </li>
                    <li th:onclick="'javascript:goToPage('+${exchanges.totalPages}+')'" class="page-item" th:classappend="${exchanges.number+1 == exchanges.totalPages}?disabled:''">
                        <a class="page-link" th:href="|?page=${exchanges.totalPages}&size=${exchanges.size}|" rel="next">›</a>
                    </li>
                </ul>
            </div>
        </div>
        <div th:replace="themes/default/layout/right_menu" ></div>

    </div>
</div>